#ifndef POSTGREFS_H
#define POSTGREFS_H

#include"config.h"
#include"pool.h"

class PostgreFS : public fusexx::fuse<PostgreFS>
{   private:
        Config config;
        ConnectionPool pool;

        static const unsigned int MAX_PATH_LENGTH = 2048; 

    public:
        PostgreFS(const Config & config);
        int main();
        
        //fuse
        static int mknod(const char *path, mode_t mode, dev_t rdev);
        static int mkdir(const char *path, mode_t mode);
        static int create(const char *path, mode_t mode, struct fuse_file_info *fi);
        static int getattr(const char *path, struct stat *stbuf); 
        static int fgetattr (const char *path, struct stat *stbuf, struct fuse_file_info *fi);
        static int readdir(const char *, void *, fuse_fill_dir_t, off_t, struct fuse_file_info *);
        static int utime(const char *path, struct utimbuf *time);
        static int chmod(const char *path, mode_t mode);
        static int chown(const char *path, uid_t uid, gid_t gid);
        static int open(const char *path, struct fuse_file_info *fi);
        static int truncate(const char *path, off_t size);
        static int read(const char *path, char *data, size_t size, off_t offset, struct fuse_file_info *fi);
        static int write(const char *path, const char *data, size_t size, off_t offset,struct fuse_file_info *fi);
        static int release(const char *path, struct fuse_file_info *fi);
        static int unlink (const char *path);
		static int rmdir (const char *path);
};

#endif
